package com.hnkywl.sts.entity.jhgl;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.base.Sjzdz;
import com.hnkywl.sts.entity.organ.*;
import com.hnkywl.sts.entity.sys.Yg;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 自购资金计划
 * Created with IntelliJ IDEA.
 * User: ZHUCHG
 * Date: 13-4-2
 * Time: 下午2:41
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "T_BIZ_ZGZJJH")
@Where(clause = "deleted!='1'")
public class Zgzjjh extends BaseEntity {
    @Id
    @SequenceGenerator(name = "seqZgzjjh", allocationSize = 1, sequenceName = "SEQ_BIZ_ZGZJJH")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqZgzjjh")
    private Long id;

    private String jhbh;

    //自购物资计划
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ZGWZJH_ID")
    private Zgwzjh zgwzjh;
    // 供应商
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "GYS_ID")
    private Qyjg gys;
    // 客户
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "KH_ID")
    private Qyjg kh;
    // 担保方
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "DBF_ID")
    private Qyjg dbf;
    // 计划年月
    private String jhnf;
    // 计划年月
    private String jhyf;
    // 品种
    private String pz;
    // 支付方式
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SJZDZ_ZFFS_ID")
    private Sjzdz zffs;
    // 毛利率
    private Double mll;
    // 备注
    private String bz;
    //合计金额
    private Double sbje;
    // 申报公司
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SBGS_ID")
    private Nbgs sbgs;
    // 申报部门
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SBBM_ID")
    private Nbbm sbbm;
    //    // 申报机构
//    @ManyToOne(fetch = FetchType.LAZY)
//    @JoinColumn(name = "SBJG_ID")
//    private Gsjg sbjg;
    // 申报人
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SBR_ID")
    private Yg sbr;
    // 资金统筹公司
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ZJTCGS_ID")
    private Nbgs zjtcgs;
    // 资金统筹部门
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ZJTCBM_ID")
    private Gsjg zjtcbm;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CGGS_ID")
    private Nbgs cggs;

    // 申报日期
    private Date sbrq = new Date();
    // 审核人
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SHR_ID")
    private Yg shr;
    // 审批类型
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SJZDZ_SPLX_ID")
    private Sjzdz splx;

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "zgzjjh", targetEntity = Zgzjjhmx.class)
    @Where(clause = "deleted=0")
    private List<Zgzjjhmx> zgzjjhmxList;
    //借款单
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "zgzjjh", targetEntity = Jkd.class)
    @Where(clause = "deleted=0")
    private List<Jkd> jkdList;
    //审批状态（已保存，已提交，已审批）   ybc ytj ysp
    private String zt = "ybc";

    // 关联流程
    @Column(name = "LC_ID")
    private String processInstanceId;

    //路径
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "Lj_ID")
    private Lj lj;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Lj getLj() {
        return lj;
    }

    public void setLj(Lj lj) {
        this.lj = lj;
    }

    public String getJhbh() {
        return jhbh;
    }

    public void setJhbh(String jhbh) {
        this.jhbh = jhbh;
    }

    public Zgwzjh getZgwzjh() {
        return zgwzjh;
    }

    public void setZgwzjh(Zgwzjh zgwzjh) {
        this.zgwzjh = zgwzjh;
    }

    public Qyjg getGys() {
        return gys;
    }

    public void setGys(Qyjg gys) {
        this.gys = gys;
    }

    public Qyjg getKh() {
        return kh;
    }

    public void setKh(Qyjg kh) {
        this.kh = kh;
    }

    public Qyjg getDbf() {
        return dbf;
    }

    public void setDbf(Qyjg dbf) {
        this.dbf = dbf;
    }

    public String getJhnf() {
        return jhnf;
    }

    public void setJhnf(String jhnf) {
        this.jhnf = jhnf;
    }

    public String getJhyf() {
        return jhyf;
    }

    public void setJhyf(String jhyf) {
        this.jhyf = jhyf;
    }

    public String getPz() {
        return pz;
    }

    public void setPz(String pz) {
        this.pz = pz;
    }

    public Sjzdz getZffs() {
        return zffs;
    }

    public void setZffs(Sjzdz zffs) {
        this.zffs = zffs;
    }

    public Double getMll() {
        return mll;
    }

    public void setMll(Double mll) {
        this.mll = mll;
    }

    public String getBz() {
        return bz;
    }

    public void setBz(String bz) {
        this.bz = bz;
    }

    public Double getSbje() {
        return sbje;
    }

    public void setSbje(Double sbje) {
        this.sbje = sbje;
    }

    public Nbgs getSbgs() {
        return sbgs;
    }

    public void setSbgs(Nbgs sbgs) {
        this.sbgs = sbgs;
    }

    public Nbbm getSbbm() {
        return sbbm;
    }

    public void setSbbm(Nbbm sbbm) {
        this.sbbm = sbbm;
    }

    public Yg getSbr() {
        return sbr;
    }

    public void setSbr(Yg sbr) {
        this.sbr = sbr;
    }

    public Nbgs getZjtcgs() {
        return zjtcgs;
    }

    public void setZjtcgs(Nbgs zjtcgs) {
        this.zjtcgs = zjtcgs;
    }

    public Gsjg getZjtcbm() {
        return zjtcbm;
    }

    public void setZjtcbm(Gsjg zjtcbm) {
        this.zjtcbm = zjtcbm;
    }

    public Nbgs getCggs() {
        return cggs;
    }

    public void setCggs(Nbgs cggs) {
        this.cggs = cggs;
    }

    public Date getSbrq() {
        return sbrq;
    }

    public void setSbrq(Date sbrq) {
        this.sbrq = sbrq;
    }

    public Yg getShr() {
        return shr;
    }

    public void setShr(Yg shr) {
        this.shr = shr;
    }

    public Sjzdz getSplx() {
        return splx;
    }

    public void setSplx(Sjzdz splx) {
        this.splx = splx;
    }

    public List<Zgzjjhmx> getZgzjjhmxList() {
        return zgzjjhmxList;
    }

    public void setZgzjjhmxList(List<Zgzjjhmx> zgzjjhmxList) {
        this.zgzjjhmxList = zgzjjhmxList;
    }

    public List<Jkd> getJkdList() {
        return jkdList;
    }

    public void setJkdList(List<Jkd> jkdList) {
        this.jkdList = jkdList;
    }

    public String getZt() {
        return zt;
    }

    public void setZt(String zt) {
        this.zt = zt;
    }

    public String getProcessInstanceId() {
        return processInstanceId;
    }

    public void setProcessInstanceId(String processInstanceId) {
        this.processInstanceId = processInstanceId;
    }
}
